package com.atguigu.thread;
import com.atguigu.pojo.TicketLock;

import java.util.concurrent.locks.ReentrantLock;

public class LockExer {
    public static void main(String[] args) {
        TicketLock ticketLock = new TicketLock();
        new Thread(() -> {while(ticketLock.determine()){ticketLock.sale();}},"A").start();
        new Thread(() -> {while(ticketLock.determine()){ticketLock.sale();}},"B").start();
        new Thread(() -> {while(ticketLock.determine()){ticketLock.sale();}},"C").start();
    }
}
